<template>
	<a-form-item
		:class="[hasError ? 'hhg-form-item-has-error' : '']"
		:label="labelName"
		:name="name"
		:rules="rules">
		<div class="uploadList">
			<div class="theme-txt">
				<!-- 文本域 -->
				<a-textarea :value="modelValue" @input="$emit('update:modelValue', $event.target.value)" v-bind="attrs" :style="[{ 'width': width, 'height': height }]" :placeholder="placeholder"></a-textarea>
			</div>
		</div>
	</a-form-item>
</template>

<script setup>
import { onMounted, ref, defineProps, useAttrs } from 'vue'
//父组件传过来的值
const props = defineProps({
  config: {
	type: Object,
	default: ()=> {}
  }
})
//组件属性穿透
const attrs = useAttrs()
const labelName = ref(props.config.labelName)
const name = ref(props.config.name)
const rules = ref(props.config.rules)
const hasError = ref(props.config.hasError ? props.config.hasError : false)

const width = ref(props.config?.width)
const height = ref(props.config?.height)
const placeholder = ref(props.config?.placeholder)
// mounted
onMounted(() => {
})

</script>
<style scoped lang="scss"></style>